<%
var headContent = {
include("/pages/template/head.html"){}
%>

<script type="text/javascript">
    var oper;
    jQuery(function($) {
        // 页面方法
        oper = {
            width : 450,
            height : 500,
            form : document.form1,
            list : function() {
                var url = 'system/auditing/list';
                this.form.action = url;
                this.form.submit();
            },
            view : function(id) {
                var url = 'system/auditing/view/'+id;
                var title = '查看详情';
                Iframe(url, this.width, this.height, title, false, false, false, EmptyFunc);
            },
            auditing : function(id) {
                var url = 'system/auditing/rejectOrPass/'+id;
                var title = '确认？';
                Confirm(title, function() {
                    form1.action = url;
                    form1.submit();
                });
            }
            
        };
        //显示Menu索引
        showMenu('page_system');
        showMenu('page_auditing');
    });

    //分页
    var paginator = function(page) {
        oper.list();
    };

</script>

<%
};

var bodyContent = {
%>
<form name="form1" action="" method="post"  class="form-inline" role="form">
	<!-- 菜单 -->
	<% include("/pages/template/menu.html"){} %>

	<div class="tableSearch">
		<%  //查询列表 %>
		<div class="form-group">
				<select name="attr.type" class="form-control" style="width:196px;" >
				<option value="">--请选择类型--</option>
				<option value="0" ${attr.type=="0"?"selected":"" }>加款</option>
				<option value="1" ${attr.type=="1"?"selected":"" }>授信</option>
				<option value="2" ${attr.type=="2"?"selected":"" }>其他</option>
			</select>
		</div>
		<div class="form-group">
		 	<select name="attr.status" class="form-control"  style="width:196px;"  >
				<option value="">--请选择状态--</option>
				<option value="0" ${attr.status=="0"?"selected":"" }>待审核</option>
				<option value="1" ${attr.status=="1"?"selected":"" }>通过</option>
				<option value="2" ${attr.status=="2"?"selected":"" }>驳回</option>
			</select>
		</div>


		<button type="button" class="btn btn-default" onclick="resetForm();">
			<span class="glyphicon glyphicon-refresh"></span> 重 置
		</button>
		<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			<span class="glyphicon glyphicon-search"></span> 查 询
		</button>
	</div>

	<!-- 数据列表 -->
	<table class="table table-striped table-bordered table-hover">
		<thead>
		<tr>
			<th>序号</th>
			<%  // 列表头部 %>
			<th style="display:none" name="ids" class="sorting">ids</th>
			<th name="customerName" >客户名称</th>
			<th name="providerName" >供应商名称</th>
			<th name="type" class="sorting">类型</th>
			<th name="status" >审核状态</th>
			<th name="chargeAmount" class="sorting">充值金额(元)</th>
			<th name="creditAmount" class="sorting">授信金额</th>
			<th name="giftAmount" class="sorting">赠送金额</th>
			<th name="remark" class="sorting">备注</th>
			<th name="createTime" class="sorting">创建时间</th>
			<th name="createPerson" class="sorting">创建人</th>
			<th name="auditTime" class="sorting">审核时间</th>
			<th name="auditPerson" class="sorting">审核人</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		<% for(item in page.list){ %>
		<tr>
			<td>${itemLP.index }</td>
			<%  // 列表内容 %>
			<td>${item.customerName}</td>
			<td>${item.providerName}</td>
			<td>
				<% if(item.type=="0") { %>
				加款
				<%	} %>
				<% if(item.type=="1") { %>
				授信
				<%	} %>
				<% if(item.type=="2") { %>
				其他
				<%	} %>
			</td>
			<td>
				<% if(item.status=="0") { %>
				待审核
				<%	} %>
				<% if(item.status=="1") { %>
				通过
				<%	} %>
				<% if(item.status=="2") { %>
				驳回
				<%	} %>
			</td>
			
			<td>${item.chargeAmount}</td>
			<td>${item.creditAmount}</td>
			<td>${item.giftAmount}</td>
			<td>${item.remark}</td>
			<td>${item.createTime}</td>
			<td>${item.createPerson}</td>
			<td>${item.auditTime}</td>
			<td>${item.auditPerson}</td>
			<td>
				<a href="javascript:void(0);" class="btn btn-sm btn-success" onclick="oper.view('${item.ids}');">查看</a>
				<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.auditing('${item.ids},1');">通过</a>
				<a href="javascript:void(0);" class="btn btn-sm btn-danger" onclick="oper.auditing('${item.ids},2');">驳回</a>
				
			</td>
		</tr>
		<% } %>
		</tbody>
	</table>
	<%include("/pages/includes/paginator.html"){} %>
</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>